In [2]:
import numpy as np
import pandas as pd
import pymc3 as pm
import matplotlib.pyplot as plt

%matplotlib inline

HOPE data

looking at RBSPA L2 SA file. 2017-06-20T13:36:58

Energies from 3850 to 27800 eV


In [28]:
df = pd.DataFrame({"FPSA":np.array([ 11444.,  20570.,  31026.,  47132.,  65090.,  67032.,  83713.,
          89785., 113910.,  91562.,  53267.,  32098.,  24499.])}, index = [ 3848.9,  4484.7,  5225.5,  6088.7,  7094.5,  8266.4,  9631.9,
               11223.0, 13077.0, 15237.0, 17754.0, 20687.0, 24104.0])
df.plot(logy=True)


Out[28]:
<matplotlib.axes._subplots.AxesSubplot at 0x1c27eea518>

In [29]:
df.plot(logy=False)


Out[29]:
<matplotlib.axes._subplots.AxesSubplot at 0x1c280fe898>

In [34]:
df.loc[12000:].plot(logy=False)


Out[34]:
<matplotlib.axes._subplots.AxesSubplot at 0x1c282c7908>

In [ ]:
# fit a Normal and expontial tail

with pm.Model() as model:
    norm_mu = pm.Flat('norm_mu')
    norm_sd = pm.Flat('norm_sd')

    norm = pm.Normal('norm', mu=norm_mu, sd=norm_sd, observed=df.values)
    trace = pm.sample()


Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Multiprocess sampling (4 chains in 4 jobs)
NUTS: [norm_sd, norm_mu]
Sampling 4 chains:  18%|█▊        | 700/4000 [00:00<00:01, 2251.37draws/s]/Users/balarsen/anaconda3/envs/python3/lib/python3.7/site-packages/numpy/core/fromnumeric.py:3118: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)

In [ ]:
p